package ru.evga.inse.core.service.impl;

import ru.evga.inse.core.dao.DaoException;
import ru.evga.inse.core.dao.IDao;
import ru.evga.inse.core.domain.BaseEntity;
import ru.evga.inse.core.service.IEntityService;

public abstract class GenericEntityService<E extends BaseEntity>
    implements IEntityService<E>
{
    abstract protected IDao<Long, E> getDao();
    
    public E find(Long id) throws DaoException
    {
        return getDao().find(id);
    }

    public void remove(Long id) throws DaoException
    {
        getDao().remove(id);
    }

    public void flush()
    {
        getDao().flush();
    }

    public Long count()
    {
        return getDao().count();
    }
    
    public Class<E> getEntityClass()
    {
        return getDao().getEntityClass();
    }

    
}
